DEB Debian package
DEB Debian package#
A Debian package is the simplest and most efficient way of distributing software in Debian-based distributions. It takes care of managing dependencies and provides a good interface for install/upgrade/uninstall operations.
Debian package is an archive that keep the files in specific project structure. During the installation the files from the package go into similar folder structure in the target relative to package root folder
package root
├── DEBIAN
│ ├── control
│ ├── postinst
│ └── preinst
├── bin
├── etc
├── usr
│ └── lib
└── tmp
deb package files follow a specific naming convention
<name>_<version>-<revision>_<architecture>.deb
Demo#
Pack python application
deb
└── build
└── test_0.0.1_amd64.deb
├── DEBIAN
│ ├── control
│ ├── postinst
│ └── preinst
└── tmp
└── py_gui_demo-0.0.1-py3-none-any.whl
Package: test
Version: 1.0-5
Section: utils
Priority: optional
Architecture: all
Maintainer: robobe <test@test.com>
Description: Python GUI application base on PySimpleGui
Depends: python3-tk
#!/bin/bash
echo post >> /tmp/test
pip install /tmp/py_gui_demo-0.0.1-py3-none-any.whl
#!/bin/bash
echo pre >> /tmp/test
build#
dpkg-deb --root-owner-group --build <package root>
check#
Lintian#
Lintian dissects Debian packages and reports bugs and policy violations. It contains automated checks for many aspects of Debian policy as well as some checks for common errors more
sudo apt install lintian
lintian <package.deb>
lintian py_gui_demo_0.0.2_amd64.deb
Install / usage#
Using apt to install the deb package and all it’s dependencies
sudo apt --fix-broken install ./test.deb